<?php
    class AdminController extends Controller
    {
        public $manager;

        // menu selected
        public $menu_parent_selected;
        public $menu_child_selected;
        public $menu_sub_selected;

        public $manager_count;
        public $post_count;
        public $bill_count;
        public $item_count;
        public $customer_count;

        public function init(){
            parent::init();
            // init properties 
            $this->manager = Yii::app()->user->isGuest ? NULL : Yii::app()->user->manager; 

            $this->manager_count = Manager::model()->count();
            $this->post_count = Post::model()->count();
            $this->bill_count = Bill::model()->count();
            $this->item_count = Item::model()->count();
            $this->customer_count = Customer::model()->count();
        }
}